package org.yenn.pattern.aliyun.behavioral.interpreter.impl;

import lombok.AllArgsConstructor;
import lombok.ToString;
import org.yenn.pattern.aliyun.behavioral.interpreter.Expression;

/**
 * 步骤 2
 * 创建实现了上述接口的实体类。
 */
@AllArgsConstructor
@ToString
public class OrExpression implements Expression {

    private Expression expr1 = null;
    private Expression expr2 = null;


    @Override
    public boolean interpret(String context) {
        return expr1.interpret(context) || expr2.interpret(context);
    }
}
